builddir=../../../build
if [ ! -d $builddir ] ; then
     mkdir $builddir
fi

reportsdir=$builddir/reports
if [ ! -d $reportsdir ] ; then
     mkdir $reportsdir
fi

scriptrepdir=$reportsdir/scripts_reports
if [ ! -d $scriptrepdir ] ; then
     mkdir $scriptrepdir
else
     rm -fr $scriptrepdir/*
fi

cachedir=../../../cache
if [ ! -d $cachedir ] ; then
     mkdir $cachedir
fi

lexdir=$cachedir/lexer_scripts
if [ ! -d $lexdir ] ; then
     mkdir $lexdir
else
     rm -fr $lexdir/*
fi

for str in "dump-encoding-param" "decode-encode" "mine-xmatrix-comp-rnd" "mine-xmatrix-comp-ot" "make-point" "make-start-point" "make-monovalent-key" "make-commitment-binomial-key" "make-commitment-sym-signature" "make-commitment-sym-certificate" "make-signature-symmetric" "make-signature-asymmetric" "make-certificate-symmetric" "make-certificate-asymmetric" "make-hash" "make-checksum" "split-symmetric" "encrypt-symmetric" "encrypt-asymmetric" "convert-hash-to-point" "make-block" "print-header" "print-lib-info" "make-ring-signature" "make-steganography-block"
do
    echo $str ; xrnlib-cli --script $str > $lexdir/$str.sh ; chmod 777 $lexdir/$str.sh ; $lexdir/$str.sh tee > $lexdir/$str.log ; 
    if [ ! -d $lexdir/$str.dir ] ; then  
        mkdir $lexdir/$str.dir
    fi 
    cp ~/.local/xoronos/cache/* $lexdir/$str.dir
done


cp $lexdir/*.log $scriptrepdir
cp -r $lexdir/*.dir $scriptrepdir
